package com.tongji.housediy.view.titlewindows
{
	import com.tongji.housediy.events.commonEvent.ClearTitleWindowEvent;
	
	import flash.events.MouseEvent;
	
	import mx.managers.PopUpManager;
	
	import org.robotlegs.mvcs.Mediator;
	
	/**
	 * 
	 * @author frank
	 * 2011/09/02
	 */
	public class MyCollectionInformationTitleWindowMediator extends Mediator
	{
		[Inject]
		public var view:MyCollectionInformationTitleWindow;
		public var count:int = 0;
		public function MyCollectionInformationTitleWindowMediator()
		{
			super();
		}
		public override function onRegister():void
		{
			view.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
			
		}
		private function mouseOutHandler(event:MouseEvent):void
		{	
			//trace(event.localX, event.localY);
			if(event.localX < view.width && event.localY < view.height && event.localX > 0 && event.localY != -1)
			{}
			else
			{
				if(event.localY == -1 && event.localX > 59 && event.localX < 119)
				{}
				else
				{
					PopUpManager.removePopUp(view);
					dispatch(new ClearTitleWindowEvent(ClearTitleWindowEvent.SET_EXIST_WINDOW_FALSE));
				}
			}
		}
	}
}